home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8998 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Why doesn't this work?
  5. Date: 05 Mar 1996 03:35:21 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Mar4203521@qcd.lanl.gov>
  8. References: <1996Mar4.161412.137442@forest>
  9. NNTP-Posting-Host: qcd.lanl.gov
  10. Mime-Version: 1.0
  11. Content-Type: text
  12. In-reply-to: ebromber@forest.drew.edu's message of 4 Mar 96 16:14:12 EST
  13.  
  14. In article <1996Mar4.161412.137442@forest>
  15. ebromber@forest.drew.edu writes:
  16.  
  17. e: Does anyone know why this password program doesn't work properly? And if 
  18. e: you do know the problem how can I fix it? It rejects every password
  19. including  
  20. e: the real password. The program was compiled using a MS-DOS compiler.
  21. e: main();
  22. e: {    char real[4];
  23.  
  24. If you know something will not change you can declare it const. If you
  25. replace this with `const char real[4]="jerk";', you will find your
  26. error :-) Of course, your method is probably better: make the program
  27. slightly more secure by scattering the ints all over.
  28.  
  29. <snip>
  30. e:     real[0]='j';real[1]='e';real[2]='r';real[3]='k';
  31. <snip>
  32. e:     for (i=0; i<4; i++)
  33. e:         if (real[i]=pass[i]) error++;
  34.  
  35. Cheers
  36. Tanmoy
  37. --
  38. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  39. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  40. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  41. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  42. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  43. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  44.